const Mock = require('mockjs')

const data = Mock.mock({
  'data|30': [{
    'id': '@id',
    'name': '@cname',
    'account|11': /[0-9]/,
    'password|6-10': '*',
    'status|1': /[0-1]/,
  }]
})

module.exports = [
  {
    url: '/vue-admin-template/seller/page',
    type: 'get',
    response: config => {
      return {
        code: 20000,
        data: data
      }
    }
  },
  {
    url: '/vue-admin-template/seller/delete',
    type: 'delete',
    response: config => {
      return {
        code: 20000,
        data: true
      }
    }
  },
  {
    url: '/vue-admin-template/seller/add',
    type: 'post',
    response: config => {
      return {
        code: 20000,
        data: true
      }
    }
  },
  {
    url: '/vue-admin-template/seller/get',
    type: 'get',
    response: config => {
      return {
        code: 20000,
        data: [{ name: '销售A' }, { name: '销售B' }, { name: '销售C' }]
      }
    }
  },
  {
    url: '/vue-admin-template/seller/reset',
    type: 'put',
    response: config => {
      return {
        code: 20000,
        data: true
      }
    }
  },
]
